package ooday03.homework01;

public class RefArrayDemo {
    public static void main(String[] args) {
        Dog[] dogs=new Dog[3];
        dogs[0]=new Dog("丧彪",1,"黑白");
        dogs[1]=new Dog("小贝",1,"灰");
        dogs[2]=new Dog("黑旋风",1,"白");
        for (int i=0;i< dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].swim();
        }
        Chick[] chicks=new Chick[2];
        chicks[0] =new Chick("白斩鸡",1,"黄");
        chicks[1]=new Chick("口水鸡",1,"白");
        for (int i=0;i< chicks.length;i++){
            System.out.println(chicks[i].name);
            chicks[i].eat();
            chicks[i].layEggs();

        }

        Fish[] fish=new Fish[2];
        fish[0]=new Fish("水煮鱼",1,"绿");
        fish[1]=new Fish("红烧鲈鱼",1,"黑");
        for (int i=0;i<fish.length;i++){
            System.out.println(fish[i].name);
            fish[i].swim();

        }

    }

}
